package ShapeModel;

import java.awt.*;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;

public class CADEllipse extends Ellipse2D.Double implements CADShape {
    private int zVal;
    private Color c;
    private float strokeWidth;



    public CADEllipse(double x, double y, double w, double h, int zVal, Color c, float strokeWidth) {
        super(x, y, w, h);
        this.zVal = zVal;
        this.c = c;
        this.strokeWidth = strokeWidth;
    }


    @Override
    public int getZ() {
        return zVal;
    }


    @Override
    public void setPos(Point2D topLeft, Point2D botRight) {
        setFrameFromDiagonal(topLeft, botRight);
    }

    @Override
    public void resize(double dtop, double dbot, double dleft, double dright) {
        Rectangle2D bound = getBounds2D();
        setPos(bound.getMinX() + dleft, bound.getMinY() + dtop, bound.getMaxX() + dright, bound.getMaxY() + dbot);
    }

    @Override
    public void setColor(Color c) {
        this.c = c;
    }

    @Override
    public Color getColor() {
        return this.c;
    }

    @Override
    public void setStrokeWidth(float width) {
        this.strokeWidth = width;
    }

    @Override
    public float getStrokeWidth() {
        return strokeWidth;
    }

    @Override
    public void setZ(int z) {
        this.zVal = z;
    }
}
